import $http from './http';

// 解疑惑-前台-首页数据-根据时间查询（包含tree分类、list、info信息）
export function getListResolveDoubts(data) {
  return $http({
    url: `/rest/resolveDoubts/listResolveDoubts`,
    method: 'post',
    data,
  });
}

// 解疑惑-前台-首页数据-根据热度查询（不包含tree分类、info信息）
export function getListByReadCount(data) {
  return $http({
    url: `/rest/resolveDoubts/listResolveDoubtsByReadCount`,
    method: 'post',
    data,
  });
}

// 新建-后台解疑惑-生成newId
export function creatRandomId() {
  return $http({
    url: `/rest/resolveDoubts/creatRandomId`,
    method: 'get',
  });
}

// 新建-解疑惑-后台-分类
export function createBoard(data) {
  return $http({
    url: `/bbs.do?method=createBoard&isGroup=false&spaceType=&spaceId=`,
    method: 'post',
    data,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
  });
}

// 修改-解疑惑-后台-分类
export function modifyBoard(data) {
  return $http({
    url: `/bbs.do?method=modifyBoard&isGroup=false&spaceType=&spaceId=`,
    method: 'post',
    data,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
  });
}

// 删除-解疑惑-后台-分类
export function delBoard(data) {
  return $http({
    url: `/bbs.do?method=delBoard&isGroup=false&spaceType=&spaceId=`,
    method: 'post',
    data,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
  });
}

// 列表查询-解疑惑-后台-部门设置
export function getQuestDepartList(params) {
  return $http({
    url: `/rest/resolveDoubts/questDepartList`,
    method: 'get',
    params,
  });
}

// 新建&修改-解疑惑-后台-部门设置
export function addOrEditQuestDepart(data) {
  return $http({
    url: `/rest/resolveDoubts/createOrUpdateQuestDepart`,
    method: 'post',
    data,
  });
}

// 删除-解疑惑-后台-部门设置
export function deleteQuestDepart(data) {
  return $http({
    url: `/rest/resolveDoubts/deleteQuestDepart`,
    method: 'post',
    data,
  });
}

// 解疑惑-前台-新增提问、点赞、点踩、回复。公共方法
export function bbsArticleManager(data) {
  return $http({
    url: `/ajax.do?method=ajaxAction&managerName=bbsArticleManager`,
    method: 'post',
    data,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
  });
}

// 解疑惑-前台-首页-根据栏目分类查询数据
export function getByColumnId(data) {
  return $http({
    url: `/rest/resolveDoubts/getByColumnId`,
    method: 'post',
    data,
  });
}

// 解疑惑-前台-提问讨论详情-根据id查询
export function getV3xBbsArticleById(data) {
  return $http({
    url: `/rest/resolveDoubts/getV3xBbsArticleById`,
    method: 'post',
    data,
  });
}

// 解疑惑-前台-我的提问列表
export function getMyQuestion(data) {
  return $http({
    url: `/rest/resolveDoubts/question`,
    method: 'post',
    data,
  });
}

// 解疑惑-前台-我的追问列表
export function getMyProbe(data) {
  return $http({
    url: `/rest/resolveDoubts/probe`,
    method: 'post',
    data,
  });
}

// 解疑惑-前台-我要回复列表
export function getMyReply(data) {
  return $http({
    url: `/rest/resolveDoubts/reply`,
    method: 'post',
    data,
  });
}

// 解疑惑-前台-回复审核列表
export function getReplyReview(data) {
  return $http({
    url: `/rest/resolveDoubts/replyReview`,
    method: 'post',
    data,
  });
}

// 解疑惑-前台新增提问-查询预置分类id
export function getBordByName(data) {
  return $http({
    url: `/rest/resolveDoubts/bordByName`,
    method: 'post',
    data,
  });
}

// 解疑惑-模糊查询卡片数据
export function getFuzzyQuery(data) {
  return $http({
    url: `/rest/resolveDoubts/fuzzyQuery`,
    method: 'post',
    data,
  });
}
